<template>
  <div class="gene-analysis-container">
    <div class="gene-analysis-item" v-for="(item, index) in geneInfo" :key="index">
      <div class="header">
        <div class="title">{{ item.name }}基因</div>
        <div class="score">
          <ScoreBar
            :scale="(item.score / item.topLimit) * 100"
            :bgColor="item.bgColor"
            :leftColor="item.leftColor"
            :rightColor="item.rightColor"
          ></ScoreBar>
          <span :style="{ color: item.scoreColor }">{{ item.score }}</span
          ><span :style="{ color: item.scoreColor }">/{{ item.topLimit }}</span>
        </div>
      </div>
      <div class="text">{{ item.analysis }}</div>
    </div>
  </div>
</template>

<script>
import ScoreBar from '@/components/common/ScoreBar.vue';
export default {
  components: {
    ScoreBar,
  },

  props: {
    geneInfo: {
      type: Array,
      default: () => [],
    },
  },
};
</script>

<style lang="less" scoped>
.gene-analysis-container {
  background-color: #fff;
  padding: 12px 0;
  .gene-analysis-item {
    margin: 12px 0 24px;
    padding: 24px;
    height: 172px;
    width: 638px;
    background-image: url('@/assets/img/gene-bg.svg');
    .header {
      display: flex;
      justify-content: space-between;
      .title {
        font-size: 28px;
        color: rgba(0, 0, 0, 0.84);
        line-height: 34px;
        font-weight: 600;
      }
      .score {
        display: flex;
        align-items: center;
        :nth-child(2) {
          font-size: 24px;
          font-family: PingFangSC-Semibold;
          line-height: 34px;
          font-weight: 600;
          width: 29px;
          text-align: right;
        }
        :nth-child(3) {
          font-size: 18px;
          opacity: 0.6;
          font-weight: 400;
          width: 31px;
          font-family: PingFangSC-Regular;
        }
      }
    }
    .text {
      margin-top: 12px;
      font-size: 28px;
      color: rgba(0, 0, 0, 0.84);
      line-height: 42px;
      font-weight: 400;
      text-align: justify;
    }
  }
}
</style>
